package com.jams.goodox.entity;

import com.jams.goodox.net.BaseEntity;

import java.util.ArrayList;
import java.util.List;

/**
 * 公司实体
 * Created by jams_zhen on 2017/6/1.
 */

public class CompanyListResp extends BaseEntity{
    private DataBean data;

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    public static class DataBean implements Mapper<List<CompanyBean>>{
        private PageInfoBean pageInfo;
        private List<ResultListBean> resultList;

        public PageInfoBean getPageInfo() {
            return pageInfo;
        }

        public void setPageInfo(PageInfoBean pageInfo) {
            this.pageInfo = pageInfo;
        }

        public List<ResultListBean> getResultList() {
            return resultList;
        }

        public void setResultList(List<ResultListBean> resultList) {
            this.resultList = resultList;
        }

        @Override
        public List<CompanyBean> transform() {
            List<CompanyBean> list=new ArrayList<>();
            if(resultList!=null&&resultList.size()>0){
                for(ResultListBean resultListBean:resultList){
                    list.add(resultListBean.transform());
                }
            }
            return list;
        }

        public static class ResultListBean implements Mapper<CompanyBean>{
            private String enterpriseId;
            private String enterpriseName;
            private String houseId;

            public String getEnterpriseId() {
                return enterpriseId;
            }

            public void setEnterpriseId(String enterpriseId) {
                this.enterpriseId = enterpriseId;
            }

            public String getEnterpriseName() {
                return enterpriseName;
            }

            public void setEnterpriseName(String enterpriseName) {
                this.enterpriseName = enterpriseName;
            }

            public String getHouseId() {
                return houseId;
            }

            public void setHouseId(String houseId) {
                this.houseId = houseId;
            }

            @Override
            public CompanyBean transform() {
                CompanyBean companyBean=new CompanyBean(enterpriseName,enterpriseId);
                return companyBean;
            }
        }
    }
}
